package com.pand.service.impl;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import java.util.List;

/**
 * Created by lh on 2018/1/17
 */

public class VehicleServiceImpl {
    @PersistenceContext
    private EntityManager em;

    List<Object> findRealLocation(int page, int size) {
        Query query = em.createQuery("select v.vehicleId,v.license,v.vinCode,vrd.longtitude,vrd.latitude,vrd.odo from RentVehicle v, VehicleRealData vrd " +
                "where v.vinCode = vrd.vin " +
                "and v.organizationId = 4");
        query.setFirstResult(page);
        query.setMaxResults(size);
        return query.getResultList();
    }
}
